
def run(task='', data_dir='', cfg_id='', github_dir='', weights='', out_dir='', device='', logger=None,
    main_queue=None, sub_queue=None, exist=True, augment=False, im_sz='',
    infer_dir='', conf_thres=0):

    if 'yolov5' in cfg_id:
        import project.yolov5 as yolov5

        cfg_id = cfg_id.replace('yolov5_', '')

        try:
            yolov5.infer.run(task=task, data_dir=data_dir, cfg_id=cfg_id, github_dir=github_dir, device=device, weights=weights, out_dir=out_dir,
                logger=logger, main_queue=main_queue, sub_queue=sub_queue, exist=exist, augment=augment, im_sz=im_sz,
                infer_dir=infer_dir, conf_thres=conf_thres)
        except Exception as e:
            if logger:
                logger.log(logger.ERROR, e, exception=True)
            if sub_queue:
                sub_queue.put({'err': str(e)})
    if 'timm' in cfg_id:
        import project.timm as timm

        cfg_id = cfg_id.replace('timm-', '')

        timm.infer.run(task=task, data_dir=data_dir, cfg_id=cfg_id, github_dir=github_dir, device=device, weights=weights, out_dir=out_dir, 
            main_queue=main_queue, sub_queue=sub_queue,
            infer_dir=infer_dir)